import request from '@/utils/request'

// 查询仓位管理列表
export function listBizWarehouseSpace (query) {
  return request({
    url: '/biz/bizWarehouseSpace/list',
    method: 'get',
    params: query
  })
}

// 查询仓位管理详细
export function listBizWarehouseSpaceByWarehouseId (warehouseId) {
  return request({
    url: '/biz/bizWarehouseSpace/listByWarehouseId/' + warehouseId,
    method: 'get'
  })
}
// 根据产品id查询仓位管理详细
export function listBizWarehouseSpaceByproductId (warehouseId,productId) {
  return request({
    url:  `/biz/bizWarehouseSpace/spaceList/${warehouseId}/${productId}`,
    method: 'get'
  })
}

// 查询仓位管理详细
export function getBizWarehouseSpace (id) {
  return request({
    url: '/biz/bizWarehouseSpace/' + id,
    method: 'get'
  })
}

// 新增仓位管理
export function addBizWarehouseSpace (data) {
  return request({
    url: '/biz/bizWarehouseSpace',
    method: 'post',
    data: data
  })
}

// 修改仓位管理
export function updateBizWarehouseSpace (data) {
  return request({
    url: '/biz/bizWarehouseSpace',
    method: 'put',
    data: data
  })
}

// 删除仓位管理
export function delBizWarehouseSpace (id) {
  return request({
    url: '/biz/bizWarehouseSpace/' + id,
    method: 'delete'
  })
}


// 导出仓位管理
export function exportBizWarehouseSpace (query) {
  return request({
    url: '/biz/bizWarehouseSpace/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/biz/bizWarehouseSpace/getInitData/' + dictTypes,
    method: 'get'
  })
}
